/ Assembly List / LJCDataAccess / DataAccess / ExecuteNonQuery

Namespace - LJCDataAccess


Parameters
sql - The non-query SQL statement.

Returns

The affected record count.

Syntax

C#
public Int32 ExecuteNonQuery(String sql)

Executes an Insert, Update or Delete statement. (E)

Example

C#
// See the DataAccess setup code on the DataAccess class page.

// Executes an Insert, Update or Delete statement.
private static void ExecuteNonQuery(DataAccess dataAccess)
{
  string sql = "delete from TableName where ID = 5";

  int affectedRecords = dataAccess.ExecuteNonQuery(sql);
}

Copyright © Lester J. Clark and Contributors.
Licensed under the MIT License.